//
//  BaseNavViewController.m
//  YL_MiKaEP
//
//  Created by yang yang on 2017/7/14.
//  Copyright © 2017年 jian wang. All rights reserved.
//

#import "BaseNavViewController.h"

@interface BaseNavViewController ()

@end

@implementation BaseNavViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIView * leftBgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 40, 40)];
    
    UIImageView * leftImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 12, 21)];
    leftImageView.image = [UIImage imageNamed:@"backShap"];
    leftImageView.center = CGPointMake(6, leftBgView.bounds.size.height/2);
    leftImageView.userInteractionEnabled = YES;
    [leftBgView addSubview:leftImageView];
    
    UITapGestureRecognizer * backTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(backTapClick)];
    [leftBgView addGestureRecognizer:backTap];
    
    UIBarButtonItem * leftBtnItem = [[UIBarButtonItem alloc]initWithCustomView:leftBgView];
    self.navigationItem.leftBarButtonItem = leftBtnItem;
    
}


-(void)backTapClick{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
